/*
 * @Author: fishroom
 * @Date: 2021-11-28 21:30:42
 * @LastEditTime: 2021-12-01 00:48:51
 * @FilePath: \front-end\src\router\index.js
 */
import Vue from "vue";
import Router from "vue-router";
import Loading from "@/view/loading/Loading";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "loading",
      component: Loading
    },
    {
      path: "/home",
      name: "home",
      // 路由懒加载常用方式
      component: () => import("@/view/home/Home")
    },
    {
      path: "/login",
      name: "login",
      // 路由懒加载方式二
      components: require("@/view/login/Login")
    },
    {
      path: "*",
      name: "404",
      // 路由 vue异步组件加载
      component: resolve => require(["@/view/404/Err"], resolve)
    }
  ],
  mode: "history"
});
